package com.tianhao.luo.nouse.v2;

import junit.framework.TestCase;
import org.junit.Test;

/**
 * @ClassName: AbstractZombieTest2
 * @Description: 策略模式测试
 * @author: tianhao.luo@hand-china.com
 * @date: 2020/7/1  17:53
 */
public class AbstractZombieTest2 extends TestCase {
    @Test
    public void test(){
        NormalZombie normalZombie = new NormalZombie();
        System.out.println("普通僵尸：");
        normalZombie.display();
        normalZombie.attack();
        normalZombie.move();
        // 我们想给僵尸传一个新攻击模式
        System.out.println("\n普通僵尸新攻击模式：");
        normalZombie.setAttackable(new HitAttack());
        normalZombie.display();
        normalZombie.attack();
        normalZombie.move();
    }

}